package site.marqstree.kotlin.usercenter.injection.component

import dagger.Component
import site.marqstree.kotlin.library.base.injection.activity.ActivityComponent
import site.marqstree.kotlin.library.base.injection.module.ModuleScope
import site.marqstree.kotlin.usercenter.ui.activity.forgetpwd.ForgetPwdActivity
import site.marqstree.kotlin.usercenter.ui.activity.login.LoginActivity
import site.marqstree.kotlin.usercenter.ui.activity.register.RegisterActivity
import site.marqstree.kotlin.usercenter.ui.activity.resetpwd.ResetPwdActivity
import site.marqstree.kotlin.usercenter.ui.activity.userinfo.UserInfoActivity


/*
 * 项目名: KotlinMall
 * 包名: site.marqstree.kotlin.usercenter.injection.component
 * 文件名: UserComponent
 * 创建者: marqstree
 * 创建时间: 2020/2/19 19:50
 * 描述: 业务层依赖工厂管理者
 * 注意：Dagger2不能跨级共享服务能力
 * 也就是MainComponent依赖于ActivityComponent，
 * 就只能使用ActivityComponent的activity实例，
 * 不能使用ApplicationComponent中的context，
 * 除非在ActivityComponent中暴露context的实例，
 * 否则在业务层使用了Context的注入编译就会报错
 */
@ModuleScope
@Component(dependencies = arrayOf(ActivityComponent::class))
interface UserComponent{
    fun inject(activity: RegisterActivity)
    fun inject(activity: LoginActivity)
    fun inject(activity: ForgetPwdActivity)
    fun inject(activity: ResetPwdActivity)
    fun inject(activity: UserInfoActivity)
}